Repository navigation
fix(id): bound records.read cap pages by the result-event limit (#4888) - #5092
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review disposition (task 8079, lane code-c): the Codex code review completed on commit 0d22749 with zero findings (codex-review-state: has_any_findings=false, has_unresolved_findings=false) — nothing to fix or rebut. CodeRabbit was rate-limited (free OSS review limit) and produced no findings. Targeted tests verified on the laptop before merge: cargo test -p id-core world_caps (7 passed), cargo test -p id records (154 passed, main suite). Merging under the standing merge authority. |
Fixes #4888 (task 8079).
Problem
execute_records_readadmitted records.read pages up to the 768 KiB session page budget (MAX_RECORDS_PAGE_BYTES), but a cap result is delivered throughresult_event, which replaces any serialized event overMAX_EVENT_BYTES(64 KiB) withresult_too_large. Any page between 64 KiB and 768 KiB passed admission yet could never reach the program — andRECORDS_READ_BOUNDSadvertised the undeliverable 768 KiB bound.Change
world_caps.rs: newMAX_RECORDS_RESULT_PAGE_BYTES = MAX_EVENT_BYTES - RESULT_EVENT_ENVELOPE_BYTES(1024-byte envelope allowance for the result wrapper, a longest request id, and a worst-case escapednext_afterkey).RECORDS_READ_BOUNDSnow reports this enforced cap-result bound.MAX_RECORDS_PAGE_BYTESstays 768 KiB for the session-protocol and web/host paths, which do not pass throughresult_event.world/actor.rs:execute_records_readnow bounds the page byMAX_RECORDS_RESULT_PAGE_BYTESand counts each entry at its true serialized size ({"key":...,"value":...}plus its array comma; serialization failure counts asusize::MAX, failing closed). A single over-bound record still fails closed asbad_args(page empty at bound).world_caps::records_result_pages_always_fit_the_result_eventbuilds a maximum-size page with a longest, escape-heavynext_afterand asserts the delivered event fitsMAX_EVENT_BYTESwithok=true, and asserts the 768 KiB session budget is unchanged;world::tests::records_read_pages_fit_the_result_event_that_delivers_themis the end-to-end regression — 16 × ~8 KiB records (~128 KiB, previously swallowed whole byresult_too_large) now deliver exactly 8 records withnext_after = r07.Verification (laptop, fleet-build-lock, CARGO_BUILD_JOBS=8)
cargo test -p id-core world_caps— 7 passed, 0 failedcargo test -p id records— 154 passed, 0 failed (main suite; all other filtered binaries ok)FUEL_BUDGETS untouched (no sandbox.rs change in this PR). Queue task 8079 · lane code-c resumed this work at the
reproducedcheckpoint; implementation commit 0d22749.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.